using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MainPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Login1_LoggedIn(object sender, EventArgs e)
    {
       string usName =((Login)sender).UserName;
      MembershipUser User = Membership.GetUser(usName);
        //jesli to pierwsze logowanie
      ForumFunctions.wskPrzeczytane = 0;
      
      string czas = User.LastLoginDate.ToString();
    }
    protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
    {
            //string usName =((LoginStatus)sender).us;
            MembershipUser User = Membership.GetUser( HttpContext.Current.User.Identity.Name);
            User.Comment = DateTime.Now.ToString();
            User.LastLoginDate = DateTime.Now;
        
    }
    protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
    {
        string usName = ((Login)sender).UserName;
        MembershipUser User = Membership.GetUser(usName);
        ForumFunctions.dataLogowania = User.LastLoginDate;
        if (ForumFunctions.dataLogowania == DateTime.MinValue)
            ForumFunctions.dataLogowania = DateTime.Now;
    }
}
